package org.bitejiuyeke.lesson01;

public class Demo01_Thread {
    public static void main(String[] args) {
        MyThread01 myThread01=new MyThread01(1);
        MyThread01 myThread011=new MyThread01(2);
        myThread011.start();
        myThread01.start();
       // myThread01.run();
       // myThread011.run();
    }

}
class  MyThread01 extends  Thread{
    int a;

    public MyThread01(int a){
        this.a=a;
    }


    @Override
    public void run() {
        while (true) {
            try {
                //休眠程序
                Thread.sleep(1000);
                System.out.println(this.a);
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }

        }
    }
}